package com.common.utils.BaseUtils;

public class StringUtil {

    /**
     * "abc_xyz" -> "abcXyz"
     * @param str
     * @return
     */
    public static String toLHCase(String str) {
        StringBuilder sb = new StringBuilder();
        for(String s : str.split("_")) {
            sb.append(toUCase(s));
        }
        return toLCase(sb.toString());
    }

    public static String toUCase(String str) {
        return ("" + str.charAt(0)).toUpperCase() + str.substring(1);
    }

    /**
     * "Abc" -> "abc"
     * @param str
     * @return
     */
    public static String toLCase(String str) {
        return ("" + str.charAt(0)).toLowerCase() + str.substring(1);
    }

    public static Boolean isEmpty( String str ){
        if( str == null && str.length() == 0 && str.trim().length()==0 ){
            return true;
        }
        return false;
    }

    public static Boolean isNotEmpty( String str ){
        return !isEmpty(str);
    }
}
